/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2024.
 * Description: RTOS self-developed code for udp.c
 * Author: Wang Haitao
 * Create: 2023/9/14
 */

#ifdef CONFIG_RTOS_NET_UDP6_UCAST_DELIVER
static int trace_vendor_udp6_lib_ucast_deliver(struct sock *sk, struct net *net,
					       struct sk_buff *skb, struct udphdr *uh,
					       struct in6_addr *saddr, struct in6_addr *daddr,
					       struct udp_table *udptable)
{
	int retval;
	if (inet_get_convert_csum(sk) && uh->check && !IS_UDPLITE(sk))
		skb_checksum_try_convert(skb, IPPROTO_UDP, ip6_compute_pseudo);
	if (p_udp6_lib_ucast_deliver) {
		if (!p_udp6_lib_ucast_deliver(sk, net, skb, uh,
					      (struct in6_addr *)saddr,
					      (struct in6_addr *)daddr, udptable))
			return 0;
	}
	retval = udpv6_queue_rcv_skb(sk, skb);
	if (retval > 0)
		return retval;
	return 0;
}
#else
static inline int trace_vendor_udp6_lib_ucast_deliver(struct sock *sk, struct net *net,
					       struct sk_buff *skb, struct udphdr *uh,
					       struct in6_addr *saddr, struct in6_addr *daddr,
					       struct udp_table *udptable)
{
	return 0;
}
#endif